import re
from urllib import request
# 自定义类
class Spider():
    json = '{"nanos":0,"time":1522399210000,"minutes":40,"seconds":10,"hours":16,"month":2,"year":118,"timezoneOffset":-480,"day":5,"date":30}'
    # 使用正则抓取需要的数据 添加？是非贪婪模式 获取（）内的内容
    json_pattern = '{"nanos":0,"time":([\d]*?),"minutes":[\d]*,"seconds":[\d]*,"hours":[\d]*,"month":[\d]*,"year":[\d]*,"timezoneOffset":-[\d]*,"day":[\d]*,"date":[\d]*}'


    def __anylysis(self,htmls):
        root_html = re.findall(Spider.root_pattern,htmls)
        
    
    def __show(self):
        print('python3得到指定字符串的时间戳')
        print(re.findall(Spider.json_pattern,Spider.json))


    # 入口方法
    def go(self):
        self.__show()

spider = Spider()
spider.go()